const SERVICE = require("../../lib/js/service.js");

Page({
  data:{
    imgSrc: SERVICE.imgUrl
  },
  onLoad(){
    let userInfo = wx.getStorageSync("userInfo");
    
    setTimeout(()=>{
      if (userInfo) {
        SERVICE.POST(SERVICE.URL.verifyUser, {
          thirdCookie: wx.getStorageSync("thirdCookie") 
        }, (status,res) => {
          let res_status = res.data.status;
          if (res_status == "expire" || res_status == "fail"){
            wx.reLaunch({
              url: "../login/login",
            });  
          } else if (res_status == "success"){
            wx.reLaunch({
              url: "../index/index",
            });
          }
        });
      } else {
        wx.reLaunch({
          url: "../login/login",
        })
      }
    },3000);
  },
  
  /*分享*/
  onShareAppMessage(){
    
  } 
});